package com.loong.common.nacos;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DynamicTools {

    private static DynamicKey dynamicKey;

    @Autowired
    public void setDynamicKey(DynamicKey dynamicKey) {
        DynamicTools.dynamicKey = dynamicKey;
    }

    public  static <T> T getDynamicKey(String key, Class<T> clazz) {
        return dynamicKey.getDynamicValue(key,clazz);
    }
}
